﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HPortal.Lib;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;

namespace HPortal.Module
{
    public partial class ChitietDetai : PanelControl
    {
        protected int DetaiID;
        protected int ChannelID;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ChannelID = DatabaseHelper.SelectScalarIntFromID("ChannelID", "Panel", PanelID);
                DetaiID = HtmlHelper.GetIdFromRequestString("DetaiID", 0);
                BindData();
            }
        }
        private void BindData()
        {
            DataTable art = DatabaseHelper.Select("[KH_ChitietDetai] " + DetaiID);
            dtvArticleView.DataSource = art;
            dtvArticleView.DataKeyNames = new string[] { "DetaiID" };
            dtvArticleView.DataBind();

            DataTable dtBaocao = DatabaseHelper.Select("[KH_BaocaoDetai] " + DetaiID);
            grvArticlelList.DataSource = dtBaocao;
            grvArticlelList.DataBind();
        }
    }
}